package com.chushouya.controller.common;

import com.general.framework.core.schema.Response;
import com.chushouya.manager.dto.admin.config.ConfigDTO;
import com.chushouya.manager.service.admin.ConfigService;
import com.chushouya.common.constant.ServiceType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "参数配置")
@RestController
@RequestMapping(ServiceType.COMMON + "/config")
public class ConfigGetterController {
    @Resource
    private ConfigService configService;

    @ApiOperation("根据参数键名查询参数值")
    @GetMapping("/getByConfigKey")
    public Response<ConfigDTO> getConfigKey(String configKey) {
        return Response.success(configService.selectConfigByKey(configKey));
    }

}
